#ifndef SWP_ITEM_COMMANDS_H
#define SWP_ITEM_COMMANDS_H

#include <QtGui/QPolygonF>
#include <QtGui/QUndoCommand>

namespace swp
{
class AbstractPolygonGraphicItem;
class AbstractRectGraphicItem;
class SwpSwimlaneGraphicItem;

class PolygonGraphicItemResizeCommand : public QUndoCommand
{
public:
    PolygonGraphicItemResizeCommand(AbstractPolygonGraphicItem* item,
        qreal xCoefficient, qreal yCoefficient, bool ignoreFirstRedo = false);
    ~PolygonGraphicItemResizeCommand();

    void undo();
    void redo();

protected:
    AbstractPolygonGraphicItem* m_item;
    qreal m_xCoefficient;
    qreal m_yCoefficient;
    bool m_ignoreFirstRedo;
};

class RectGraphicItemResizeCommand : public QUndoCommand
{
public:
    RectGraphicItemResizeCommand(AbstractRectGraphicItem* item,
        qreal xCoefficient, qreal yCoefficient, bool ignoreFirstRedo = false);
    ~RectGraphicItemResizeCommand();

    void undo();
    void redo();

protected:
    AbstractRectGraphicItem* m_item;
    qreal m_xCoefficient;
    qreal m_yCoefficient;
    bool m_ignoreFirstRedo;
};

class SwapSwimlanesCommand : public QUndoCommand
{
public:
    SwapSwimlanesCommand(SwpSwimlaneGraphicItem* first,
        SwpSwimlaneGraphicItem* second);
    ~SwapSwimlanesCommand();

    void undo();
    void redo();

protected:
    SwpSwimlaneGraphicItem* m_first;
    SwpSwimlaneGraphicItem* m_second;
};

} // namespace swp

#endif
